Use config file instead of editing source code#210
Use config file instead of editing source code#210Leonidas-from-XIV wants to merge 10 commits intoocaml-dune:mainfrom
Conversation
c7c4698 to
4db6a38
Compare
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
The values are taken from the nightly workflow. Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
4db6a38 to
ef99b87
Compare
Signed-off-by: Marek Kubica <marek@tarides.com>
|
Looks ok to me. It might be worth re-asking: Do we really want to get rid of staging? Isn't the point to isolate from "prod"? |
|
I think we should have a way to test this, but the way this is currently setup is a mess:
What I think would be better is to have two environments with completely separate This is however a definitely out of the scope of this PR (and possibly more work than building a better design from scratch). So I can try to make this work with the staging branch but I am unsure whether it's worth the added work. @shonfeder what do you think? |
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
7bcebf5 to
c2822a3
Compare
| dream | ||
| dream-encoding | ||
| tailwindcss | ||
| (toml (>= 7)) |
There was a problem hiding this comment.
If we need a runtime loadable config file, why not just use JSON? We already have yojson as a dep so it saves a dependency, we are already using jsonh and it avoids the need introduce yet another config format into the code base.
But, see my following comments, as I don't understand why we need a runtime loadable config file.
| - name: Export executables and generate HTML (test) | ||
| if: ${{ inputs.test }} | ||
| run: ./_build/install/default/bin/sandworm sync --commit "${{ needs.check_build.outputs.commit }}" --tag "${{ needs.check_build.outputs.release }}" --config config-test.toml | ||
|
|
||
| - name: Export executables and generate HTML (production) | ||
| if: ${{ !inputs.test }} |
There was a problem hiding this comment.
Why do we need run-time loadable configuration files at all? Couldn't we just have a CLI flag that selected which of two records to use (or which of two modules, using the current approach).
| module Server = struct | ||
| let bucket_dir = "/dune/" | ||
| let rclone_bucket_ref = Format.sprintf "dune-binary-distribution:%s" bucket_dir | ||
| let url = "https://get.dune.build/" | ||
| module type FILE = sig | ||
| val file_name : string | ||
| end | ||
|
|
||
| module Path = struct | ||
| let artifacts_dir = "./artifacts" | ||
| let metadata = "./metadata.json" | ||
| let rclone = "./rclone.conf" | ||
| let install = "./static/install" |
There was a problem hiding this comment.
Following on my previous question, why not just keep the data in OCaml and have a CLI flag to pick which of two different configs to us? Then we avoid needing any deserialization or runtime config loading.
| - name: Export executables and generate html | ||
| shell: bash | ||
| - name: Export executables and generate HTML (test) | ||
| if: ${{ github.ref == 'refs/heads/staging' }} |
There was a problem hiding this comment.
The PR description says we are getting rid the "staging" branch? But looks not?
I don't see a problem with keeping "the database" in the source code for a project like this. It give us an easy way to rollback, and keeps the infra minimal. Could we address your concerns with a
IMO, it is important that we can test changes before merging them into the trunk. But that doesn't necessarily mean we need a fixed staging branch: rather a way of deploying a selected branch to the staging environment. Does this make sense? |
| if: ${{ github.ref == 'refs/heads/staging' }} | ||
| run: ./_build/install/default/bin/sandworm sync --commit "${{ needs.binary.outputs.git-commit }}" --config config-test.toml | ||
|
|
||
| - name: Export executables and generate HTML (production) | ||
| if: ${{ github.ref != 'refs/heads/staging' }} |
There was a problem hiding this comment.
Should this rather require that the branch is main?
|
|
||
| - name: Export executables and generate html | ||
| shell: bash | ||
| - name: Export executables and generate HTML (test) |
There was a problem hiding this comment.
The test/prod distinction seems the most important thing here. So maybe a more evident naming like this?
| - name: Export executables and generate HTML (test) | |
| - name: 'TEST -- Export executables and generate HTML' |
This PR changes the way Sandworm is reconfigured by moving from editing sourcecode as part of an GH workflow into using a config file.
Some notes about it:
testas an option to its execution. We need to rework how to test things in either case.Closes #199